import request from '@/utils/request'

// export function fetchDepartmentList() {
//   return request({
//     url: '/company/department',
//     method: 'GET'
//   })
// }

export const fetchDepartmentList = () => request.get('/company/department')

// 获取部门负责人列表
// export function fetchManagerList() {
//     return request({
//       url: '/sys/user/simple',
//       method: 'GET'
//     })
//   }

export const fetchManagerList = () => request.get('/sys/user/simple')

// export function fetchAddDepart(data) {
//   return request({
//     url: '/company/department',
//     method: 'POST',
//     data
//   })
// }

export const fetchAddDepart = data => request.post('/company/department', data)

// 删除
// export function fetchDelDepart(id) {
//   return request({
//     url: `/company/department/${id}`,
//     method: 'DELETE'
//   })
// }

export const fetchDelDepart = id => request.delete(`/company/department/${id}`)

// 获取详情
// export function fetchDetail(id) {
//   return request({
//     url: `/company/department/${id}`,
//     method: 'GET'
//   })
// }

export const fetchDetail = id => request.get(`/company/department/${id}`)

// 更新
// export function fetchUpdateDepart(data) {
//   return request({
//     url: `/company/department/${data.id}`,
//     method: 'PUT',
//     data
//   })
// }

export const fetchUpdateDepart = data => request.put(`/company/department/${data.id}`, data)
